home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
4671-5.790
/
dmg-5179
/
bos
/
demotut
< prev
next >
Wrap
Text File
|
1995-09-09
|
4KB
|
89 lines
************************************
* WRITE YOUR VERY OWN DEMO IN STOS *
************************************
* BY JD *
This series aims to give STOS users a peek into the demo world
with small demos and examples coded in STOS every month, giving
you an excellent start into coding in STOS with professional
looking games, demos etc.
First, install STOSDEMO.TOS and de-archive it as shown in the HOW TO
EXTRACT ARCHIVES article. You will then have a file called DIGIDEMO.BAS.
Load up STOS and run it!
Please note you will need the Misty extension by Top Notch to run it,
if you you haven't got this, write to the usual B.O.S. address, enclosing
a disk and an S.A.E., and I'll send it to you.
This demo is the Digidemo, and is part of our megademo, 'Cool as Fire'
which can be obtained by sending three disks and an S.A.E. to the B.O.S.
address.
It works by playing Quartet modules held in banks 5, 6, 7, 8, 9 and 11
using the Quartet player code held in bank 15. The Quartet voice file is
held in bank 10.
Line 10 sets up the screen for action.
Lines 20-26 set up the text for the 3 scrollines, in the strings M$, N$
and O$.
Lines 30-60 set up the scroll zones for the scrollers.
Line 100 unpacks the screen held in bank 14 to bank 2 and gosubs to line
4000 where code for my special 'Pour up' appear is held.
Lines 110-130 does the scrolling.
It then gosubs to line 500 where the inkey$ are tested to see if a key is
pressed. If 1-6 is pressed, the tune is changed. This is done by selecting
a different Quartet music bank and gosubbing to line 1000 where the music
is stopped and then started again with the new music bank playing.
Lines 1000-3000 play and stop the music.
To play music:
Dreg(0)=0 : call 15 : ' Install player code
Dreg(0)=5 : call 15 : ' Select soundchip
Dreg(0)=1 : areg(0)=start( music bank (B) ) : areg(1)=start( voice bank)
: call 15 ' Play music
To stop music:
Dreg(0)=2 : call 15 : ' Stop music
Dreg(0)=3 : call 15 : ' De-install player code
This music plays on interrupt, so you can do a limited amount of things
whilst it plays. N.B. a lot of processor time is used to play the music,
but it sounds great and is far better than having a module playing because
you can do other things than have just a static screen display.
That's about it, so go on, try it out!
If you would like to see more code like this, I can supply you with four
disks full! It is the full source code to our megademo, 'Cool as Fire' and is
available to you for just £5! Please make all cheques out to J.Davidson, and
send it to the usual B.O.S. address. I'll then send you the four disks and
you'll have enough code to last you a lifetime!
Also send all articles, letters etc, STOS questions, tips, advice to
that address. I will be pleased to answer any STOS related
questions.
As a bonus, I've included the source code to the menu screen and doc displayer
that you are reading this with. Just extract MENUCODE.TOS in the usual way and
run MENU.BAS in STOS. Please note, it requires MENU.MUS to be present in the
B.O.S. folder, so just insert this disk in the drive when you run it!
Also, the menu screen needs to have the Missing Link and Misty extensions to
be able to run properly, which are available from me if you haven't got them.
Have fun, remember you must register if you want to be able to use these
examples!
See ya!, JD!